﻿@model EnterpriseFund.Model.AllowanceIssue
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title></title>
    @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)


    <script type="text/javascript">

        function ValueChanded() {
            var year = FYear.GetText();
            var allowanceClassNo = FAllowanceClassNo.GetValue();
            $.ajax({
                type: 'POST',
                url: rootPath + '/AllowanceIssueManage/GetFIssueNo',
                data: { year: year, allowanceClassNo: allowanceClassNo },
                success: function (result) {
                    if (result == "ex") {
                        alert("参数异常");
                    }
                    else {
                        ASPxClientTextBox.Cast("FIssueNo").SetText(result);
                    }
                }
            });
        }
        function OK() {
            form1.submit();
        }




        $(document).ready(function () {
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert == "操作成功") {
                parent.codeOK();
            }
            else {
                if (hdjsAlert != "") {
                    alert(hdjsAlert);
                }
            }
        });

       
    </script>

</head>
<body>
    @using (Html.BeginForm("Save", "AllowanceIssueManage", FormMethod.Post, new { id = "form1" }))
    {
    <table class="tableFrom">
        <tr>
            <th style=" width:150">
               年度:</th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FYear";
                   settings.Width = 200;
                   settings.Text = Model.FYear.ToString();
                   settings.Properties.MaskSettings.Mask = "yyyy";
                   settings.Properties.ClientSideEvents.ValueChanged = "ValueChanded";
                   settings.Properties.MaxLength = 4;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <th style=" width:150">
                 补贴方式:</th>
            <td>
               @Html.DevExpress().ComboBox(settings =>
          {
              settings.Name = "FAllowanceClassNo";
              settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
              settings.Width = 200;
              settings.Properties.TextField = "FAllowanceName";
              settings.Properties.ValueField = "FAllowanceClassNo";
              settings.Properties.ClientSideEvents.ValueChanged = "ValueChanded";
          }).BindList(ViewData["AllowanceClassList"]).Bind(Model.FAllowanceClassNo).GetHtml()
            </td>
        </tr>
          <tr>
            <th style=" width:150">
               期号:</th>
            <td>
                @Html.DevExpress().TextBox(settings =>
                {
                    settings.Name = "FIssueNo";
                    settings.Width = 200;
                    settings.Text = Model.FIssueNo;
                    settings.ReadOnly = true;
                   // settings.Enabled = false;
                    settings.ControlStyle.ForeColor = System.Drawing.Color.FromArgb(176,160,191);
                    settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                    settings.Properties.ValidationSettings.EnableCustomValidation = true;
                }).GetHtml()
            </td>
        </tr>
      
    </table>
         @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));
    }
    <script>
        lp.Hide();
    </script>

</body>
</html>
